package com.zyd.mappers;

import com.zyd.io.model.StationEntity;
import com.zyd.io.model.StationEntityExample;
import com.zyd.io.model.StationEntityKey;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface StationEntityMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_station
     *
     * @mbg.generated Fri Nov 09 22:45:59 CST 2018
     */
    @SelectProvider(type=StationEntitySqlProvider.class, method="countByExample")
    long countByExample(StationEntityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_station
     *
     * @mbg.generated Fri Nov 09 22:45:59 CST 2018
     */
    @DeleteProvider(type=StationEntitySqlProvider.class, method="deleteByExample")
    int deleteByExample(StationEntityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_station
     *
     * @mbg.generated Fri Nov 09 22:45:59 CST 2018
     */
    @Delete({
            "delete from zydzn_station",
            "where id = #{id,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(StationEntityKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_station
     *
     * @mbg.generated Fri Nov 09 22:45:59 CST 2018
     */
    @Insert({
            "insert into zydzn_station (id, stationid, ",
            "stationcode, stationname, ",
            "address, jd, wd, ",
            "port, linestate, ",
            "fence, regtime, ",
            "state, note, createtime, ",
            "ts, createid, dr, ",
            "area, areaid, stationstatus)",
            "values (#{id,jdbcType=VARCHAR}, #{stationid,jdbcType=VARCHAR}, ",
            "#{stationcode,jdbcType=VARCHAR}, #{stationname,jdbcType=VARCHAR}, ",
            "#{address,jdbcType=VARCHAR}, #{jd,jdbcType=VARCHAR}, #{wd,jdbcType=VARCHAR}, ",
            "#{port,jdbcType=VARCHAR}, #{linestate,jdbcType=INTEGER}, ",
            "#{fence,jdbcType=INTEGER}, #{regtime,jdbcType=VARCHAR}, ",
            "#{state,jdbcType=INTEGER}, #{note,jdbcType=VARCHAR}, #{createtime,jdbcType=VARCHAR}, ",
            "#{ts,jdbcType=VARCHAR}, #{createid,jdbcType=VARCHAR}, #{dr,jdbcType=INTEGER}, ",
            "#{area,jdbcType=VARCHAR}, #{areaid,jdbcType=VARCHAR}, #{stationstatus,jdbcType=VARCHAR})"
    })
    int insert(StationEntity record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_station
     *
     * @mbg.generated Fri Nov 09 22:45:59 CST 2018
     */
    @InsertProvider(type=StationEntitySqlProvider.class, method="insertSelective")
    int insertSelective(StationEntity record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_station
     *
     * @mbg.generated Fri Nov 09 22:45:59 CST 2018
     */
    @SelectProvider(type=StationEntitySqlProvider.class, method="selectByExample")
    @Results({
            @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
            @Result(column="stationid", property="stationid", jdbcType=JdbcType.VARCHAR),
            @Result(column="stationcode", property="stationcode", jdbcType=JdbcType.VARCHAR),
            @Result(column="stationname", property="stationname", jdbcType=JdbcType.VARCHAR),
            @Result(column="address", property="address", jdbcType=JdbcType.VARCHAR),
            @Result(column="jd", property="jd", jdbcType=JdbcType.VARCHAR),
            @Result(column="wd", property="wd", jdbcType=JdbcType.VARCHAR),
            @Result(column="port", property="port", jdbcType=JdbcType.VARCHAR),
            @Result(column="linestate", property="linestate", jdbcType=JdbcType.INTEGER),
            @Result(column="fence", property="fence", jdbcType=JdbcType.INTEGER),
            @Result(column="regtime", property="regtime", jdbcType=JdbcType.VARCHAR),
            @Result(column="state", property="state", jdbcType=JdbcType.INTEGER),
            @Result(column="note", property="note", jdbcType=JdbcType.VARCHAR),
            @Result(column="createtime", property="createtime", jdbcType=JdbcType.VARCHAR),
            @Result(column="ts", property="ts", jdbcType=JdbcType.VARCHAR),
            @Result(column="createid", property="createid", jdbcType=JdbcType.VARCHAR),
            @Result(column="dr", property="dr", jdbcType=JdbcType.INTEGER),
            @Result(column="area", property="area", jdbcType=JdbcType.VARCHAR),
            @Result(column="areaid", property="areaid", jdbcType=JdbcType.VARCHAR),
            @Result(column="stationstatus", property="stationstatus", jdbcType=JdbcType.VARCHAR)
    })
    List<StationEntity> selectByExample(StationEntityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_station
     *
     * @mbg.generated Fri Nov 09 22:45:59 CST 2018
     */
    @Select({
            "select",
            "id, stationid, stationcode, stationname, address, jd, wd, port, linestate, fence, ",
            "regtime, state, note, createtime, ts, createid, dr, area, areaid, stationstatus",
            "from zydzn_station",
            "where id = #{id,jdbcType=VARCHAR}"
    })
    @Results({
            @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
            @Result(column="stationid", property="stationid", jdbcType=JdbcType.VARCHAR),
            @Result(column="stationcode", property="stationcode", jdbcType=JdbcType.VARCHAR),
            @Result(column="stationname", property="stationname", jdbcType=JdbcType.VARCHAR),
            @Result(column="address", property="address", jdbcType=JdbcType.VARCHAR),
            @Result(column="jd", property="jd", jdbcType=JdbcType.VARCHAR),
            @Result(column="wd", property="wd", jdbcType=JdbcType.VARCHAR),
            @Result(column="port", property="port", jdbcType=JdbcType.VARCHAR),
            @Result(column="linestate", property="linestate", jdbcType=JdbcType.INTEGER),
            @Result(column="fence", property="fence", jdbcType=JdbcType.INTEGER),
            @Result(column="regtime", property="regtime", jdbcType=JdbcType.VARCHAR),
            @Result(column="state", property="state", jdbcType=JdbcType.INTEGER),
            @Result(column="note", property="note", jdbcType=JdbcType.VARCHAR),
            @Result(column="createtime", property="createtime", jdbcType=JdbcType.VARCHAR),
            @Result(column="ts", property="ts", jdbcType=JdbcType.VARCHAR),
            @Result(column="createid", property="createid", jdbcType=JdbcType.VARCHAR),
            @Result(column="dr", property="dr", jdbcType=JdbcType.INTEGER),
            @Result(column="area", property="area", jdbcType=JdbcType.VARCHAR),
            @Result(column="areaid", property="areaid", jdbcType=JdbcType.VARCHAR),
            @Result(column="stationstatus", property="stationstatus", jdbcType=JdbcType.VARCHAR)
    })
    StationEntity selectByPrimaryKey(StationEntityKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_station
     *
     * @mbg.generated Fri Nov 09 22:45:59 CST 2018
     */
    @UpdateProvider(type=StationEntitySqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") StationEntity record, @Param("example") StationEntityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_station
     *
     * @mbg.generated Fri Nov 09 22:45:59 CST 2018
     */
    @UpdateProvider(type=StationEntitySqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") StationEntity record, @Param("example") StationEntityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_station
     *
     * @mbg.generated Fri Nov 09 22:45:59 CST 2018
     */
    @UpdateProvider(type=StationEntitySqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(StationEntity record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zydzn_station
     *
     * @mbg.generated Fri Nov 09 22:45:59 CST 2018
     */
    @Update({
            "update zydzn_station",
            "set stationid = #{stationid,jdbcType=VARCHAR},",
            "stationcode = #{stationcode,jdbcType=VARCHAR},",
            "stationname = #{stationname,jdbcType=VARCHAR},",
            "address = #{address,jdbcType=VARCHAR},",
            "jd = #{jd,jdbcType=VARCHAR},",
            "wd = #{wd,jdbcType=VARCHAR},",
            "port = #{port,jdbcType=VARCHAR},",
            "linestate = #{linestate,jdbcType=INTEGER},",
            "fence = #{fence,jdbcType=INTEGER},",
            "regtime = #{regtime,jdbcType=VARCHAR},",
            "state = #{state,jdbcType=INTEGER},",
            "note = #{note,jdbcType=VARCHAR},",
            "createtime = #{createtime,jdbcType=VARCHAR},",
            "ts = #{ts,jdbcType=VARCHAR},",
            "createid = #{createid,jdbcType=VARCHAR},",
            "dr = #{dr,jdbcType=INTEGER},",
            "area = #{area,jdbcType=VARCHAR},",
            "areaid = #{areaid,jdbcType=VARCHAR},",
            "stationstatus = #{stationstatus,jdbcType=VARCHAR}",
            "where id = #{id,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(StationEntity record);


}